import sys
sys.path.append('/Users/chengyanan/PycharmProjects/kuai8_appium')
from handle.login_handle import LoginHandle

class Login_Business:
    def __init__(self, i):
        print('Login_Business-----------', i)
        self.login_hanle = LoginHandle(i)

    def login_pass(self):
        print('login_passlogin_passlogin_passlogin_passlogin_passlogin_passlogin_pass')
        # 登录成功
        # self.login_hanle.click_navbar()
        # self.login_hanle.click_my()
        self.login_hanle.send_username('13260310593')
        self.login_hanle.send_password('1111')
        self.login_hanle.click_login_button()

    def login_error(self):
        # 密码错误
        self.login_hanle.click_navbar()
        self.login_hanle.click_my()
        self.login_hanle.send_username('13260310593')
        self.login_hanle.send_password('1231')
        self.login_hanle.click_login_button()
        user_flag = self.login_hanle.get_fail_tost('验证码错误')
        if user_flag:
            return True
        else:
            return False
